package cn.datawin.bms.modules.customer.service.impl;

import cn.datawin.bms.customer.entity.CstmCustomerCmppConfigEntity;
import cn.datawin.bms.modules.customer.mapper.CstmCustomerCmppConfigMapper;
import cn.datawin.bms.modules.customer.service.CstmCustomerCmppConfigService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
 * 下游客户cmpp配置
 *
 * @author datawin-sms
 * @date 2025-06-17 17:18:08
 */
@Service
public class CstmCustomerCmppConfigServiceImpl extends ServiceImpl<CstmCustomerCmppConfigMapper, CstmCustomerCmppConfigEntity> implements CstmCustomerCmppConfigService {

	/**
	 * 根据客户id更新cmpp配置
	 * @param customerId 客户id
	 * @param config cmpp配置
	 */
	@Override
    public void updateByCustomerId(Long customerId, CstmCustomerCmppConfigEntity config) {
        LambdaQueryWrapper<CstmCustomerCmppConfigEntity> queryWrapper = Wrappers.lambdaQuery(CstmCustomerCmppConfigEntity.class)
                .eq(CstmCustomerCmppConfigEntity::getCustomerId, customerId);
		baseMapper.update(config, queryWrapper);
    }

}
